package com.zenith.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@Configuration
public class Argon2Config {
    @Bean
    public PasswordEncoder passwordEncoder() {
        // 参数：saltLength, hashLength, parallelism, memory, iterations（盐长度，哈希长度，并行度，内存，迭代次数）
        return new Argon2PasswordEncoder(16, 32, 1, 65536, 3);
    }
}
